﻿using System.Collections.Generic;

namespace Uranus.WeiStationAPI.Models
{
    public class ControllerProperty
    {
        /// <summary>
        /// 控制器全局状态
        /// </summary>
        public static List<ControllerDTO> ControllerDtos = new List<ControllerDTO>();

        /// <summary>
        /// 控制器状态校验
        /// </summary>
        /// <param name="controllname"></param>
        /// <param name="methodname"></param>
        public static ControllerDTO GetCurrentControllerDto(string controllname, string methodname)
        {
            foreach (ControllerDTO controllerDto in ControllerDtos)
            {
                if (controllerDto.controllername == controllname && controllerDto.methodname == methodname)
                {
                    return controllerDto;
                }
            }
            return null;
        }
    }
    public class ControllerDTO
    {
        /// <summary>
        /// 控制器名称
        /// </summary>
        public string controllername;
        /// <summary>
        /// 方法名称
        /// </summary>
        public string methodname { get; set; }
        /// <summary>
        /// 是否需要强制登陆
        /// </summary>
        public VisitUserStateEnum VisitUserStateEnum { get; set; }

        /// <summary>
        /// 是否需要加密验证
        /// </summary>
        public bool enEncryption { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public bool enAuthHuifu { get; set; }
    }
}